home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / tcl / xf2.3-p / xf2 / xf2.3 / xftutorial / script.xf / design.scrpt next >
Encoding:
Text File  |  1993-11-20  |  3.5 KB  |  99 lines

  1. # tutorial
  2. global designLast
  3. set designLast 3
  4. global designLastSectionDone
  5. set designLastSectionDone -1
  6.  
  7.  
  8. set designName0 {Application design}
  9. set designText0 {\
  10. Usually the construction of an application begins with
  11. a deep meditation on the purpose and the look alike of
  12. the planned application (ahem... so much for the
  13. theory. In real life you call XF and play around with
  14. it's features :-).
  15.  
  16. Typically a Tcl/Tk application has one main dialog
  17. window. From here you activate (display) other dialog
  18. windows and activate the different features of your
  19. application. Writing applications without such a main
  20. dialog window is hard with Tcl/Tk, as there is one
  21. window that is always displayed. This window is
  22. named ".". It is the root for all other windows
  23. (widgets) in your application. Destroying this
  24. window, destroys the application. This can affect
  25. the way of your dialog handling and should be
  26. considered when you plan your application.}
  27.  
  28.  
  29. set designName1 {Application design}
  30. set designText1 {\
  31. The main window (you remember: the one named "." :-)
  32. contains a combination of widgets that form the
  33. interface. For dialog components that do not need to
  34. be in the main dialog window, you can use additional
  35. toplevel widgets. A toplevel widget is almost the
  36. same as the main window. It is managed by the window
  37. manager and can contain widgets. The difference to
  38. the main window is that these windows can be removed
  39. when they are no longer needed.
  40.  
  41. The different toplevel windows contain structures of
  42. sub widgets. Widgets can contain widgets, and this
  43. combination of widgets forms the interface of your
  44. application. Widgets are organized/accessed via their
  45. names. A widget that is the child of another widget
  46. is accessed by concatenating the names of the parents
  47. separated by a point. The widget named "button1", that
  48. is a children of the frame "frame1", is accessed with
  49. the name ".frame1.button1".}
  50.  
  51.  
  52. set designName2 {Application design}
  53. set designText2 {\
  54. To organize the layout of your application you can
  55. use the packer and/or the placer. The packer allows
  56. you to pack all widgets in some kind of stack. You
  57. append the widgets to the already packed widgets.
  58. The placer allows you to specify the position and
  59. size of each widget directly.
  60.  
  61. You should play with these two ways of layouting.
  62. In most cases you will find, that the packer is
  63. more powerful (at least this is my opinion). It
  64. is possible, but not recommended, to combine the
  65. two layouting methods in the same toplevel window.
  66. The combination of both methods should only be
  67. used by the experienced user, as it is necessary
  68. that both concepts are really understood in their
  69. effects.}
  70.  
  71.  
  72. set designName3 {Application design}
  73. set designText3 {\
  74. It is recommended that you read the manual page
  75. for the packer/placer and/or the chapter in this
  76. tutorial that describes the usage of these
  77. layouting methods. Without any knowledge about
  78. this, it could happen that you get frustrated
  79. when you use XF (and that would be annoying for
  80. you and for me :-).
  81.  
  82. The functionality of you application is bound to
  83. the widget, and is activated via these. The
  84. functionality of the program is normally
  85. implemented by using Tcl/Tk. Here your Tcl/Tk
  86. experience is needed (respectively: here you
  87. gain Tcl/Tk experience :-).
  88.  
  89. This step by step approach is idealized. You will
  90. never really work this way. There are always
  91. changes to the widget structure, layout or
  92. functionality that occur in the middle of your
  93. work, due to enhancements or necessary changes.
  94. Nevertheless this view of designing and
  95. implementing applications with XF can be
  96. a helpful baseline for your work.}
  97.  
  98.  
  99.